package com.ruoyi.dl.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlProblemMapper;
import com.ruoyi.dl.domain.DlProblem;
import com.ruoyi.dl.service.IDlProblemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 问题反馈Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-28
 */
@Service
public class DlProblemServiceImpl implements IDlProblemService {
    @Autowired
    private DlProblemMapper dlProblemMapper;

    /**
     * 查询问题反馈
     *
     * @param id 问题反馈ID
     * @return 问题反馈
     */
    @Override
    public DlProblem selectDlProblemById(Integer id) {
        return dlProblemMapper.selectDlProblemById(id);
    }

    /**
     * 查询问题反馈列表
     *
     * @param dlProblem 问题反馈
     * @return 问题反馈
     */
    @Override
    public List<DlProblem> selectDlProblemList(DlProblem dlProblem) {
        return dlProblemMapper.selectDlProblemList(dlProblem);
    }

    //关联用户
    @Override
    public List<DlProblem> newSelectDlProblemList(DlProblem dlProblem) {
        return dlProblemMapper.newSelectDlProblemList(dlProblem);
    }

    /**
     * 新增问题反馈
     *
     * @param dlProblem 问题反馈
     * @return 结果
     */
    @Override
    public int insertDlProblem(DlProblem dlProblem) {
        dlProblem.setCreateTime(DateUtils.getNowDate());
        return dlProblemMapper.insertDlProblem(dlProblem);
    }

    /**
     * 修改问题反馈
     *
     * @param dlProblem 问题反馈
     * @return 结果
     */
    @Override
    public int updateDlProblem(DlProblem dlProblem) {
        return dlProblemMapper.updateDlProblem(dlProblem);
    }

    /**
     * 删除问题反馈对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlProblemByIds(String ids) {
        return dlProblemMapper.deleteDlProblemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除问题反馈信息
     *
     * @param id 问题反馈ID
     * @return 结果
     */
    @Override
    public int deleteDlProblemById(Integer id) {
        return dlProblemMapper.deleteDlProblemById(id);
    }
}
